<template>
    <div id="concerning" class="person-detail">
        <div>
               <van-nav-bar
               :fixed="true"
                    title="关于"
                    left-arrow
                    @click-left="back()"
                 />
            </div>
       <div  style="background:#fff;">
           <div>
                <svg-icon icon-class="logo@1x" widthW="10em" heightH="10em"></svg-icon>
                <p class="concerning-logo">智慧社区</p>
               <p>当前版本 V1.0.0.12873</p>
           </div>
           <van-cell-group>
                <van-cell title="功能介绍" is-link to="/person/features" />
                <van-cell title="检查新版本" is-link @click.native="checkVersion()"  />
            </van-cell-group>
            <div>
                <p class="opacity" style="color: #596D97;">《智慧社区服务条款》和《智慧社区管理细则》</p>
                <p class="opacity">Copyright © 1997-2019 Ichinae-中电兴发 </p>
            </div>
       </div>
    </div>
</template>
<script>
import mine from '../../../controller/mine'
export default {
    name: 'concerning',
    components: {},
    data() {
        return {
        }
    },
    computed: {},
    created() {},
    mounted() {},
    methods: {
        checkVersion(){
            let data =  {
                "version": "Vsersion 7.0.1"
                }
            mine.appVersion_v1_app_force(data).then(res=>{
                if(res.code == '0' && res.datas.appForceIndicator){
                    const toast = this.$toast({
                        duration: 0,       // 持续展示 toast
                        forbidClick: true, // 禁用背景点击
                        type: 'loading',
                        loadingType:'spinner',
                        message: ''
                    });
                    let second = 3;
                    const timer = setInterval(() => {
                        second --;
                        if(second == 1){
                            toast.type = 'success' 
                            toast.message = '已是最新版本'
                        }if(!second){
                            clearInterval(timer);
                            this.$toast.clear();
                        }
                    }, 1000);
                }else{
                    this.$toast(res.msg)
                }
            })
        },
        back(){
            this.$router.go(-1)
        },
    }
}
</script>
<style lang="scss" scoped>
@import '../style/index.scss';
#concerning{
    background: #fff;
    >div:nth-child(2){
    text-align: center;
    padding: 4em 1em 0 1em;
    .concerning-logo{
        font-size: 21px;
        color: #333333;
        letter-spacing: 0;
    }
    >div:nth-child(1){
        font-size: 14px;
        >p{
             margin: 1em 0 1em 0;
        }
    }
    .van-cell{
        text-align: left;
    }
    >div:nth-child(3){
        font-size: 14px;
        margin-top: 180px;
    }
    .opacity{
        padding: 2px;
        margin: 0;
    }
}
}
</style>
